<?php
/* --------------------------------------------------------------
   gm_pdf_adress_format.inc.php 2008-03-17 gambio
   Gambio OHG
   http://www.gambio.de
   Copyright (c) 2008 Gambio OHG
   Released under the GNU General Public License (Version 2)
   [http://www.gnu.org/licenses/gpl-2.0.html]
   --------------------------------------------------------------

gm_pdf_adress_format.inc.php 2008-01-31 mb
	Gambio OHG
	http://www.gambio.de
	Copyright (c) 2008 Gambio OHG
   Released under the GNU General Public License (Version 2)
   [http://www.gnu.org/licenses/gpl-2.0.html]
	--------------------------------------------------------------
*/
	
function gm_pdf_adress_format($string){
	$adress = explode('###', $string);

	foreach($adress as $value) {
		if(!empty($value)) {
			$new_adress .= trim($value) . ', ';
		}
	}

	return substr($new_adress, 0, strlen($new_adress)-2);
}
?>